package com.example.terminalservice.common;

import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 28142
 * @description 用户状态枚举类
 * @date 2023/8/5 9:24
 */
@Getter
public enum StatusEnum {
    /**
     * 用户状态：禁用
     */
    DISABLE(false, "禁用"),
    /**
     * 用户状态：正常
     */
    ENABLE(true, "正常");

    private Boolean value;
    private String label;

    StatusEnum(Boolean value, String label) {
        this.value = value;
        this.label = label;
    }

    public static List<Map<String, Object>> getStatusEnum() {
        List<Map<String, Object>> list = new ArrayList<>();
        for (StatusEnum value : StatusEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("label", value.getLabel());
            map.put("value", value.getValue());
            list.add(map);
        }
        return list;
    }
}
